<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试项目</title>
    <script src="/static/js/axios-0.18.0.min.js"></script>
    <script>
        axios.get('http://127.0.0.1:8000/test2/')
        .then(function(response){
            alert(response.data.message)
        })
        .catch(function(error){
            alert(error.response.status)
        });

        axios.post('http://127.0.0.1:8000/test2/')
        .then(function(response){
            alert(response.data.message)
        })
        .catch(function(error){
            alert(error.response.status)
        });
    </script>
</head>
<body>
<h2>测试项目</h2>
</body>
</html>